#ifndef __EMPIRE_H
#define __EMPIRE_H

#include <time.h>
#include <stdbool.h>

#define EMPIRE_MAX_PLAYERS 20

void enterEmpire(void);

typedef struct EmpirePlayer {
	char	taxRate;
	char	turnsRemaining;
	time_t	lastPlayed;
	int		playerNumber;
	int		userNumber;
	long	gold;
	long	acres;
	long	lumber;
	long	food;
	long	stone;
	long	peasants;
	int		mines;
	int		lumbermills;
	int		markets;
	int		foundries;
	int		pubs;
	int		brothels;
	int		banks;
	int		keeps;
	bool	hasMoat;
	bool	hasArcherSlots;
	bool	hasPorticulis;
	bool	hasMoatMonster;
	long	Infantry;
	long	Archers;
	long	Cavalry;
	long	Catapults;
	long	Knights;
	long	Nobles;
	char	kingdomName[21];
	time_t	wipedOutOn;
	char	wipedOutBy[21];
	bool	attackedToday[EMPIRE_MAX_PLAYERS];
} empirePlayer_t;

extern empirePlayer_t _currentEmpirePlayer;

typedef enum EmpireBuildings {
	EB_LUMBERMILL,
	EB_MINE, 
	EB_MARKET,
	EB_FOUNDRY,
	EB_BROTHEL,
	EB_PUB,
	EB_BANK,
	EB_COUNT
} empireBuildings_t;

typedef struct EmpireBuilding {
	empireBuildings_t	type;
	char				name[21];
	int					stoneRequired;
	int					lumberRequired;
	int					goldRequired;
	int					peasantsRequired;
	int					baseStoneYield;
	int					baseLumberYield;
	int					baseGoldYield;
} empireBuilding_t;

extern empireBuilding_t _empireBuildings[];

typedef struct EmpirePlayerIndexRecord {
	int		userNumber;
	char	alias[21];
	char	kingdonName[21];
	long	acres;
	long	gold;
	long	might;
} empirePlayerIdxRec_t;

typedef struct EmpireGame {
	time_t	startedOn;
	char	numberOfPlayers;
	char	turnsPerDay;
	
	int		startingPeasants;
	int		startingAcres;
	int		startingLumber;
	int		startingStone;
	int		startingGold;
	
	int		startingInfantry;
	int		startingArchers;
	int		startingCavalry;
	int		startingCatapults;
	int		startingKnights;
	int		startingNobles;

	int		priceInfantry;
	int		priceArcher;
	int		priceCavalry;
	int		priceCatapult;
	int		priceKnight;
	int		priceNoble;

	long	totalAcres;
	long	totalPeasants;
	long	totalGold;
	long	totalInfantry;
	long	totalArchers;
	long	totalCavalry;
	long	totalCatapults;
	long	totalKnights;
	long	totalNobles;

	empirePlayerIdxRec_t players[EMPIRE_MAX_PLAYERS];
} empire_t;

extern empire_t _empireSettings;



#endif